<?php
require("HTTPPost.php");

$xml = file_get_contents("xml/data.xml");

// make request to FOP server
$httppost=new HTTPPost();
$pdfdata=$httppost->post_request("personal-tbjenni.enterpriselab.ch","80","events-xsl-fo.xsl",$xml);

// save PDF output to a PDF file
$myFile = "testFile.pdf";
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, $pdfdata);
fclose($fh);

?>

<p>Das Dokument wurde generiert. <a href="testFile.pdf" target="_blank">Öffnen</a></p>